home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swaga_c.zip / ANSI.SWG / 0009_THEDRAW UNCRUNCH Image.pas < prev    next >
Pascal/Delphi Source File  |  1993-05-28  |  4KB  |  83 lines

  1. {Reading in a thedraw image :)
  2. }
  3. Procedure UNCRUNCH (Var Addr1,Addr2; BlkLen:Integer);
  4.  
  5. begin
  6.   Inline (
  7.     $1E/               {       PUSH    DS             ;Save data segment.}
  8.     $C5/$B6/ADDR1/     {       LDS     SI,[BP+Addr1]  ;Source Address}
  9.     $C4/$BE/ADDR2/     {       LES     DI,[BP+Addr2]  ;Destination Addr}
  10.     $8B/$8E/BLKLEN/    {       MOV     CX,[BP+BlkLen] ;Length of block}
  11.     $E3/$5B/           {       JCXZ    Done}
  12.     $8B/$D7/           {       MOV     DX,DI          ;Save X coordinate For
  13. later.}
  14.     $33/$C0/           {       xor     AX,AX          ;Set Current attributes.}
  15.     $FC/               {       CLD}
  16.     $AC/               {LOOPA: LODSB                  ;Get next Character.}
  17.     $3C/$20/           {       CMP     AL,32          ;if a control Character,
  18. jump.}
  19.     $72/$05/           {       JC      ForeGround}
  20.     $AB/               {       StoSW                  ;Save letter on screen.}
  21.     $E2/$F8/           {Next:  LOOP    LOOPA}
  22.     $EB/$4C/           {       JMP     Short Done}
  23.                        {ForeGround:}
  24.     $3C/$10/           {       CMP     AL,16          ;if less than 16, then
  25. change the}
  26.     $73/$07/           {       JNC     BackGround     ;Foreground color.
  27. otherwise jump.}
  28.     $80/$E4/$F0/       {       and     AH,0F0H        ;Strip off old
  29. Foreground.}
  30.     $0A/$E0/           {       or      AH,AL}
  31.     $EB/$F1/           {       JMP     Next}
  32.                        {BackGround:}
  33.     $3C/$18/           {       CMP     AL,24          ;if less than 24, then
  34. change the}
  35.     $74/$13/           {       JZ      NextLine       ;background color.  if
  36. exactly 24,}
  37.     $73/$19/           {       JNC     FlashBittoggle ;then jump down to next
  38. line.}
  39.     $2C/$10/           {       SUB     AL,16          ;otherwise jump to
  40. multiple output}
  41.     $02/$C0/           {       ADD     AL,AL          ;routines.}
  42.     $02/$C0/           {       ADD     AL,AL}
  43.     $02/$C0/           {       ADD     AL,AL}
  44.     $02/$C0/           {       ADD     AL,AL}
  45.     $80/$E4/$8F/       {       and     AH,8FH         ;Strip off old
  46. background.}
  47.     $0A/$E0/           {       or      AH,AL}
  48.     $EB/$DA/           {       JMP     Next}
  49.                        {NextLine:}
  50.     $81/$C2/$A0/$00/   {       ADD     DX,160         ;if equal to 24,}
  51.     $8B/$FA/           {       MOV     DI,DX          ;then jump down to}
  52.     $EB/$D2/           {       JMP     Next           ;the next line.}
  53.                        {FlashBittoggle:}
  54.     $3C/$1B/           {       CMP     AL,27          ;Does user want to toggle
  55. the blink}
  56.     $72/$07/           {       JC      MultiOutput    ;attribute?}
  57.     $75/$CC/           {       JNZ     Next}
  58.     $80/$F4/$80/       {       xor     AH,128         ;Done.}
  59.     $EB/$C7/           {       JMP     Next}
  60.                        {MultiOutput:}
  61.     $3C/$19/           {       CMP     AL,25          ;Set Z flag if
  62. multi-space output.}
  63.     $8B/$D9/           {       MOV     BX,CX          ;Save main counter.}
  64.     $AC/               {       LODSB                  ;Get count of number of
  65. times}
  66.     $8A/$C8/           {       MOV     CL,AL          ;to display Character.}
  67.     $B0/$20/           {       MOV     AL,32}
  68.     $74/$02/           {       JZ      StartOutput    ;Jump here if displaying
  69. spaces.}
  70.     $AC/               {       LODSB                  ;otherwise get Character
  71. to use.}
  72.     $4B/               {       DEC     BX             ;Adjust main counter.}
  73.                        {StartOutput:}
  74.     $32/$ED/           {       xor     CH,CH}
  75.     $41/               {       inC     CX}
  76.     $F3/$AB/           {       REP StoSW}
  77.     $8B/$CB/           {       MOV     CX,BX}
  78.     $49/               {       DEC     CX             ;Adjust main counter.}
  79.     $E0/$AA/           {       LOOPNZ  LOOPA          ;Loop if anything else to
  80. do...}
  81.     $1F);              {Done:  POP     DS             ;Restore data segment.}
  82. end; {UNCRUNCH}
  83.